# _*_ coding: utf-8 _*_
# @Time : 2024-01-20 18:12
# @Author : wf
import time

from selenium import webdriver
from selenium.webdriver.common.by import By

options = webdriver.ChromeOptions()
options.add_experimental_option('detach', True)
options.add_experimental_option("excludeSwitches", ["enable-automation"])  # 禁止控制提示

options.add_argument('--start-maximized')  # 设置窗口最大化

driver = webdriver.Chrome(options=options)
# driver.get('https://www.jd.com/')
driver.get('https://www.baidu.com')

ele = driver.find_element(By.ID, 'su')
print(ele.get_attribute("class"))
print(ele.get_attribute("value"))
print(ele.tag_name)

print("==================")
ele = driver.find_element(By.LINK_TEXT, '新闻')
print(ele.get_attribute("class"))
print(ele.get_attribute("href"))
print(ele.tag_name)
print(ele.text)

driver.find_element(By.NAME, 'wd').send_keys('我的世界\n')
time.sleep(30)
